<template>
	<view class="goods_list">
		<GoodsItem v-for="(item,index) in list" :key="index" :item="item" :show_check="show_check" />
		<tn-empty v-if="list.length === 0" mode="cart" style="margin-top: 200rpx"></tn-empty>
	</view>
</template>

<script>
	import GoodsItem from './goods_item.vue'
	export default {
		props: {
			list: {
				type: Array,
				default: () => ([{
					img_path: '/static/goods/apple.jpg',
					name: '土豆',
					price: 1.5,
					unit: '斤',
					number: 2,
					selected: true,
					show_check: false
				}, {
					img_path: '/static/goods/apple.jpg',
					name: '大白菜',
					price: 2,
					unit: '斤',
					number: 0,
					selected: false,
					show_check: false
				}, {
					img_path: '/static/goods/apple.jpg',
					name: '黄瓜',
					price: 3,
					unit: '斤',
					number: 0,
					selected: false,
					show_check: false
				}])
			},
			show_check: {
				type: Boolean,
				default: false
			}

		},
		components: {
			GoodsItem
		},
		data() {
			return {
				current_number: 0,
			}
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style scoped lang="scss">
	.goods_list {
		padding: 0 20rpx;
		min-height: 800rpx;
	}
</style>